﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Services;
using Volo.Abp.Users;

namespace NP.BPMReportPlatform
{
    /// <summary>
    /// 配置管理
    /// </summary>
    public class ConfigManager : IDomainService, ITransientDependency
    {
        private readonly IConfiguration _configuration;

        public ConfigManager(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        /// <summary>
        /// DownloadFileURL
        /// </summary>
        public string DownloadFileURL
        {
            get
            {
                return _configuration["BPM:DownloadFileURL"];
            }
        }


        /// <summary>
        /// PcUrlTemplate
        /// </summary>
        public string PcUrlTemplate
        {
            get
            {
                return _configuration["BPM:PcUrlTemplate"];
            }
        }

        /// <summary>
        /// MobileUrlTemplate
        /// </summary>
        public string MobileUrlTemplate
        {
            get
            {
                return _configuration["BPM:MobileUrlTemplate"];
            }
        }

        /// <summary>
        /// PCStartUrl
        /// </summary>
        public string PCStartUrl
        {
            get
            {
                return _configuration["BPM:PCStartUrl"];
            }
        }

        /// <summary>
        /// PCStartUrl
        /// </summary>
        public string MBStartUrl
        {
            get
            {
                return _configuration["BPM:MBStartUrl"];
            }
        }

        /// <summary>
        /// PCMTStartUrl
        /// </summary>
        public string PCMTStartUrl
        {
            get
            {
                return _configuration["BPM:PCMTStartUrl"];
            }
        }

        /// <summary>
        /// TokenTimeout
        /// </summary>
        public int TokenTimeout
        {
            get
            {
                return Convert.ToInt32(_configuration["BPM:TokenTimeout"]);
            }
        }

        public bool NeedSendEmail
        {
            get
            {
                return _configuration["NeedSendEmail"] == "true";
            }
        }

        public string BPMReportUrl
        {
            get
            {
                return _configuration["ReportWebUrl"];
            }
        }

        public string HRBPMReportUrl
        {
            get
            {
                return _configuration["HRReportWebUrl"];
            }
        }
    }
}
